<!DOCTYPE HTML>
<html style="background: #f3f3f3;">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>法援宝</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/lawyer.css" />
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../script/mobile.js"></script>
    <script type="text/javascript" src="../script/lawyer.js"></script>
      <style type="text/css">
        .personal_list ul li a{
            justify-content: space-between;
        }
        .point{
            position: absolute;
            top: -0.06rem;
            right: -0.05rem;
            width: 0.15rem;
            height: 0.15rem;
            border-radius: 50%;
            background: #ff0000;
        }

    </style>
</head>
<body>
<div id="secHeader"></div>
<section class="personal_info">
    <a href="javascript:void (0);" onclick="aaplay('personal_info','personal_info.html')">
        <img src="../image/user_tx.png" alt="" id='icon'>
        <div class="info">
            <p id='name'>登录/注册</p>
            <span id='pass'></span>
        </div>
    </a>
     <a href="javascript:;" onclick="aaplay('personal_setting_news_user')" class="personal_message" style="position: absolute;top: 0.3rem; right: 3%;background: none;"><img src="../image/pm1.png" style="width:auto;height: .34rem;margin-right: 0;border-radius: 0;"><em class="point" style="display: none;"></em></a>
</section>
<section class="money">
    <ul>
        <li><p><b id='balance'>0.00</b>元</p><span>账户余额</span></li>
        <li><p><b id='reward'>0.00</b>元</p><span>邀请奖励</span></li>
    </ul>
</section>
<section class="personal_list" style="padding-bottom: 1.5rem;">
    <ul>
        <li id="one" style="display: none;"><a href="javascript:;">企业会员<span style="color:#999999;" onclick="aaplay('service_package')">成为会员</span></a></li>
        <li id="two" style="display: none;"><a href="javascript:;">企业会员<span style="color:#999999;" class="betime"></span></a></li>

        <li><a href="javascript:;" onclick="aaplay('personal_myOrder','personal_myOrder.html')">我的订单</a></li>
        <li><a href="javascript:;" onclick="aaplay('personal_myContract','personal_myContract.html');" >合同文书</a></li>
        <li><a href="javascript:;" onclick="detailPlay('wtmy',1)">我的委托订单</a></li>
        <li><a href="javascript:;" onclick="aaplay('personal_money','personal_money.html')">我的钱包</a></li>
        <li><a href="javascript:;" onclick="aaplay('personal_distribution','personal_distribution.html')">分享奖励</a></li>
        <li><a href="javascript:;" onclick="aaplay('personal_mind','personal_mind.html')">收到的心意</a></li>
        <li><a href="javascript:;" onclick="aaplay('mycollection','mycollection.html')">我的收藏</a></li>
        <li><a href="javascript:;" onclick="aaplay('mypl','mypl.html')">我的评价</a></li>
        <li><a href="javascript:;" onclick="aaplay('personal_myOrder_ssbq','personal_myOrder_ssbq.html')">诉讼保全</a></li>
        <li><a href="javascript:;" onclick="aaplay('personal_setting','personal_setting.html')">设置</a></li>

    </ul>
</section>


<section class="fixed_nav">
    <ul>
        <li class=""><a href="workbench.html"><h6 class="icon"></h6>工作台</a></li>
        <li class=""><a href="news.html"><h6 class="icon"></h6>资讯</a></li>
        <li class=""><a href="find.html"><h6 class="icon"></h6>发现</a></li>
        <li class="active"><a ><h6 class="icon"></h6>我的</a></li>
    </ul>
</section>


</body>

<script>

    apiready = function () {
      $api.fixStatusBar( $api.dom('#secHeader') );
      api.setStatusBarStyle({
          style: 'light'
      });

        var result = loginCheck();
        if(result == false){
            return false;
        }

        //  alert(token);
        /*if(user.icon.indexOf('http')==0){
            $('#icon').attr('src',user.icon); //用户头像
        }else{
            $('#icon').attr('src',webSiteUrl+user.icon); //用户头像
        }*/
        //console.log(JSON.stringify(token))
        if(token!=''&&token!=null&&token!=undefined){
          user()
          notice();
        }

        //下拉刷新
        api.setRefreshHeaderInfo({
          visible: true,
          bgColor: 'rgba(255,255,255,255)',
          textColor: '#666',
          textDown: '下拉刷新',
          textUp: '释放刷新'
        }, function(ret, err) {
          toDoRefresh();
        });

    };
    function notice(){
        if(token==''){
            return false
        }
        p= {token:token};
        api.ajax({
            url: webSiteUrl+'/app/user/notice',
            method: 'post',
            data: {
                values: p
            }
        }, function(ret, err) {

            //console.log(ret.data)
            if(ret.code==200){
                $('.point').show()

            }else{
                $('.point').hide()

            }
        });
    }


    function user() {
        var p={token:token,infock:2};
        api.ajax({
            url: webSiteUrl+'/app/user/user',
            method: 'post',
            data: {
                values:p
            }
        }, function(ret, err) {
            if(ret.code==200){
                //alert(JSON.stringify(ret.data))
                $('#name').html(ret.data.nickname);
                $('#balance').html(ret.data.balance);
                $('#reward').html(ret.data.reward);

                if(ret.data.icon.indexOf('http')==0){
                    $('#icon').attr('src',ret.data.icon); //用户头像
                }else{
                    $('#icon').attr('src',webSiteUrl+ret.data.icon); //用户头像
                }

                if(ret.data.pass==1){
                    $('#pass').html('已认证')
                }else{
                    $('#pass').html('未认证')
                }

                /* if(ret.data.vip==0){
                    $('#one').show()
                    $('#two').hide()
                }else{
                    $('#one').hide()
                    $('#two').show()
                    $('.betime').html('有效期至'+ret.data.user_time)
                }*/
            }else if(ret.code == 501){
              alert(ret.msg)
              aaplay('login');
            }else{
              alert(ret.msg)
            }
        });

    }
</script>
</html>
